#pragma once

/////////////////////////////////////////////////
/// \class SocketBase
///
/// \brief Provide common socket operations
///
/// Socket Base class
/////////////////////////////////////////////////
class SocketBase
{
public:
	SocketBase();
	virtual ~SocketBase();

	/////////////////////////////////////////////////
	/// \fn int GetHandler()
	/// \brief Set the socket handler
	/// \param hSock the socket handler
	/////////////////////////////////////////////////
	void SetHandler(int hSock);

	/////////////////////////////////////////////////
	/// \fn int GetHandler()
	/// \brief Set the socket handler
	/// \return the socket handler
	/////////////////////////////////////////////////
	int GetHandler();

	/////////////////////////////////////////////////
	/// \fn int Close()
	/// \brief Close the socket handler
	/// \return Error code of this operation, zero for success, others for errors.
	/////////////////////////////////////////////////
	int Close();
private:
	int m_hSock;	/// The socket handler
};
